package com.github.zyf.ioaj.network.utils;

/**
 * @author zyf
 */
public enum ActFunctionType {
    SIGMOID("sigmoid", "{\\frac{1}{1+e^{-x}}}"),
    SWISH("swish", "{\\frac{x}{1+e^{-x}}}"),
    TANH("tanh", "{\\tanh{x}}"),
    RELU("ReLu", "{\\begin{cases}x&x\\ge0\\\\0&x<0\\end{cases}}"),
    PRELU("PReLu", "{\\begin{cases}x&x\\ge0\\\\a{\\cdot}x&x<0\\end{cases}}"),
    LEAKY_RELU("LeakyReLU", "{\\begin{cases}x&x\\ge0\\\\0.01{\\cdot}x&x<0\\end{cases}}"),
    ELU("ELU", "{\\begin{cases}x&x\\ge0\\\\a{\\cdot}\\left(e^{x}-1\\right)&x<0\\end{cases}}"),
    SOFT_PLUS("SoftPlus", "{\\ln\\left(1+e^{x}\\right)}");

    private final String key;
    private final String expressionLatex;

    ActFunctionType(String key, String expressionLatex) {
        this.key = key;
        this.expressionLatex = expressionLatex;
    }

    public String getKey() {
        return key;
    }

    public String getExpressionLatex() {
        return expressionLatex;
    }
}
